//
//  Message.m
//  cliqset
//
//  Created by David Hinson on 3/30/09.
//  Copyright 2009 Cliqset, Inc.. All rights reserved.
//

#import "Message.h"

// cliqset message
@implementation Message

@synthesize messageIdentifier = _messageIdentifier;
@synthesize sender            = _sender;
@synthesize subject           = _subject;
@synthesize recipients        = _recipients;
@synthesize timeSent          = _timeSent;
@synthesize read              = _read;
@synthesize body              = _body;
@synthesize mode              = _mode;

-(id)init {
	self = [super init];
	
	self.sender     = [[Sender alloc] init];
	self.recipients = [[NSMutableArray alloc] init];
	
	return self;
}

-(void)dealloc {
	[_sender release];
	[_recipients release];
	[_messageIdentifier release];
	[_subject release];
	[_timeSent release];
	[_read release];
	[_body release];
	[super dealloc];
}

@end

// Sender
@implementation Sender

@synthesize userIdentifier = _userIdentifier;
@synthesize givenName      = _givenName;
@synthesize familyName     = _familyName;
@synthesize gender         = _gender;
@synthesize avatarURL      = _avatarURL;
@synthesize avatarBlob     = _avatarBlob;
@synthesize hometown       = _hometown;

-(id)init {
	self = [super init];
	return self;
}

-(void)dealloc {
	[_userIdentifier release];
	[_givenName release];
	[_familyName release];
	[_gender release];
	[_avatarURL release];
	[_avatarBlob release];
	[_hometown release];
	[super dealloc];
}

@end

